package org.uned.agonzalo16.bitacora.web.article;

import org.hibernate.validator.constraints.NotBlank;
import org.uned.agonzalo16.bitacora.domain.Article;

public class ArticleForm {

	private Long blogId;
	private Long id;

	@NotBlank
	private String title;
	private String text;
	private boolean openComments;

	public ArticleForm() {
	}

	public ArticleForm(Long blogId) {
		this.blogId = blogId;
	}

	public ArticleForm(Article article) {
		this.blogId = article.getBlog().getId();
		this.id = article.getId();
		this.title = article.getTitle();
		this.text = article.getText();
		this.openComments = article.isOpenComments();
	}

	public Long getBlogId() {
		return blogId;
	}

	public void setBlogId(Long blogId) {
		this.blogId = blogId;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public boolean isOpenComments() {
		return openComments;
	}

	public void setOpenComments(boolean openComments) {
		this.openComments = openComments;
	}
}
